/* GUI CONVERTED from ropcnabl.p (converter v1.75) Tue Jun 19 12:34:26 2001 */
/* ropcnabl.p - ENABLE REL 7.4 PCC Routing MAINTENANCE                  */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.6.1.4 $                                                         */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 8.6      LAST MODIFIED: 10/08/96   BY: John Worden   *K00C*      */
/* REVISION: 8.6      LAST MODIFIED: 01/07/96   BY: John Worden   *K04N*      */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan         */
/* REVISION: 8.6E     LAST MODIFIED: 09/04/98   BY: *K1WV* Thomas Fernandes   */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 09/15/99   BY: *N02Q* Prashanth Narayan  */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb                */
/* $Revision: 1.6.1.4 $    BY: Indu Arora     DATE: 06/18/01 ECO: *N0ZK*          */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/
{mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE ropcnabl_p_1 "Routings"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define variable ro_yn like mfc_logical label {&ropcnabl_p_1}.
define variable yn like mfc_logical.
define variable l_routings as character format "x(16)".


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
ro_yn  colon 40
 SKIP(.4)  /*GUI*/
with frame a attr-space side-labels width 80 NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

view frame a.

/* REMOVED USE OF mfc_ctrl TABLE FOR THE FIELD VALUE ro_enable. */
/* NOW IT USES ONLY pcc_routing_ok FIELD OF pcc_ctrl TABLE.     */

repeat with frame a:
   do transaction:
      find mfc_ctrl where mfc_field = "ro_enable" exclusive-lock
         no-error.
      if available mfc_ctrl then do:
         delete mfc_ctrl.
      end.
   end.

   for first pcc_ctrl fields (pcc_routing_ok) no-lock:
   end.
   if available pcc_ctrl
      and pcc_routing_ok
   then ro_yn = yes.
   else ro_yn = no.

   update ro_yn.
   assign ro_yn.

   yn = yes.
   if ro_yn then do:
      /*BEGIN PROCESS*/
      {pxmsg.i &MSGNUM=5647 &ERRORLEVEL=1 &CONFIRM=yn}
   end.

   if yn then
      main: /* Start transaction main */
   do transaction on error undo main, leave main:
/*GUI*/ if global-beam-me-up then undo, leave.

      find first pcc_ctrl exclusive-lock no-error.
      if not available pcc_ctrl then
         create pcc_ctrl.
      assign
         pcc_ctrl.pcc_routing_ok = ro_yn
         l_routings = getTermLabel("ROUTINGS",16).

      if ro_yn then
      do:
         /* ROUTINGS NOW BE MAINTAINED USING PCO MAINTENANCE */
         {pxmsg.i &MSGNUM=2165 &ERRORLEVEL=1
                  &MSGARG1="l_routings"}
      end. /* IF ro_yn */
      else
      do:
         /* ROUTINGS HAS BEEN DISABLED IN PCO MAINTENANCE */
         {pxmsg.i &MSGNUM=1684 &ERRORLEVEL=1
                  &MSGARG1="l_routings"}
      end. /* IF ro_yn = no */

   end.
/*GUI*/ if global-beam-me-up then undo, leave.
 /* End transaction main */

end. /* repeat with frame a */
